
all: kernel_mod mkfs.vvsfs truncate view.vvsfs mmap_test ioctl_decrypt ioctl_encrypt ioctl_size hello

ioctl_decrypt: ioctl_decrypt.c
	gcc -Wall -o $@ $<

ioctl_encrypt: ioctl_encrypt.c
	gcc -Wall -o $@ $<

ioctl_size: ioctl_size.c
	gcc -Wall -o $@ $<

hello: hello.s
	gcc -c $<
	ld -s -o $@ $@.o

mmap_test: mmap_test.c
	gcc -Wall -o $@ $<

mkfs.vvsfs: mkfs.vvsfs.c
	gcc -Wall -o $@ $<

truncate: truncate.c
	gcc -Wall -o $@ $<

view.vvsfs: view.vvsfs.c
	gcc -Wall -o $@ $<

ifneq ($(KERNELRELEASE),)
# kbuild part of makefile, for backwards compatibility
include Kbuild

else
# normal makefile
KDIR ?= /usr/src/linux-headers-`uname -r`

kernel_mod:
	$(MAKE) -C $(KDIR) M=$$PWD

endif
